import request from "@/utils/request";

/**
 * 获取权限点列表
 */
export const getPermissionsApi = () => {
  return request({
    method: "GET",
    url: "/sys/permission",
  });
};
/**
 * 新增权限
 */
export const addPermissionsApi = (data) => {
  return request({
    method: "POST",
    url: "/sys/permission",
    data,
  });
};
/**
 * 删除权限
 */
export const deletePermissionsApi = (id) => {
  return request({
    method: "DELETE",
    url: `/sys/permission/${id}`,
  });
};
/**
 *获取权限详情
 */
export const getPermDetailApi = (id) => {
  return request({
    method: "GET",
    url: `/sys/permission/${id}`,
  });
};
/**
 * 编辑权限
 */
export const putPermissionsApi = (data) => {
  return request({
    method: "PUT",
    url: `/sys/permission/${data.id}`,
    data,
  });
};
